package com.dao.entity;

import javax.persistence.Entity;

import com.dao.entity.base.BaseEntity;

/**
 * 专员
 * @author geliyang
 *
 */
@SuppressWarnings("serial")
@Entity(name="loan_commissioner")
public class Commissioner extends BaseEntity{
	
	private String account;

	private String userName;
    
    private String password;
    
    private Integer role;
    
    private String idCard;
    
    private String openId;
    
    private Integer isApproval;
    
    private int sex;
    
    public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

    public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

	public Integer getRole() {
		return role;
	}

	public void setRole(Integer role) {
		this.role = role;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public Integer getIsApproval() {
		return isApproval;
	}

	public void setIsApproval(Integer isApproval) {
		this.isApproval = isApproval;
	}
	
	public String getIdCardBlur() {
		if(idCard != null) {
			int i = idCard.length();
			String start = idCard.substring(0, 4);
			String end = idCard.substring(i-4, i);
			return start + "*****" + end;
		}
		return null;
	}
	
	public String getSexText() {
		switch (this.sex){
		case 1:
			return "男";
		case 0:
			return "女";
		}
		return "女";
	}
}
